﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ComputerArchitecture.Numbers;

namespace ComputerArchitecture.Units.Float
{
    public static class FloatUnit
    {
        public static IUnsignedBitNumber RemoveFirstBit(IBitNumber mantissa)
        {
            IUnsignedBitNumber value = new UnsignedBitNumber(mantissa.Size - 1);
            mantissa.CopyTo(value, 0, 1, value.Size);
            return value;
        }

        public static IUnsignedBitNumber GetUnsignedOffset(int size)
        {
            IUnsignedBitNumber v = new UnsignedBitNumber(size);
            for (int i = 1; i < size; ++i)
            {
                v[i].Set();
            }
            return v;
        }

        public static ISignedBitNumber GetSignedOffset(int size)
        {
            ISignedBitNumber v = new SignedBitNumber(size);
            for (int i = 1; i < size; ++i)
            {
                v[i].Set();
            }
            return v;
        }
    }
}
